﻿using System.Collections.Generic;
using System.Web;

namespace Model.Sys.Constant
{
    /// <summary>
    /// 常量类（弥补Enum只能存储int的局限）
    /// </summary>
    public class Constant
    {
        /// <summary>
        /// 系统物理路径集合
        /// </summary>
        public static class PhysicalPath
        {
            /// <summary>
            /// 站点配置文件物理路径
            /// </summary>
            public static string SiteConfigPhysicalPath
            {
                get
                {
                    return HttpContext.Current.Server.MapPath("/Configuration/SiteConfig.config");
                }
            }
            /// <summary>
            /// 权限配置文件物理路径
            /// </summary>
            public static string PowerConfigPhysicalPath
            {
                get
                {
                    return HttpContext.Current.Server.MapPath("/Configuration/PowerConfig.config");
                }
            }
        }

        /// <summary>
        /// 系统缓存键集合
        /// </summary>
        public static class CacheKey
        {
            /// <summary>
            /// 站点信息缓存key
            /// </summary>
            public static string SiteConfigCacheKey
            {
                get
                {
                    return "SiteConfig";
                }
            }
            /// <summary>
            /// UserInfo登录缓存key
            /// </summary>
            public static string UserInfoLoginCacheKey
            {
                get
                {
                    return "UserInfoLogin";
                }
            }
            /// <summary>
            /// 权限信息缓存key
            /// </summary>
            public static string PowerConfigCacheKey 
            {
                get
                {
                    return "PowerConfig";
                }
            }
            
            public static Dictionary<string, string> List = new Dictionary<string, string>();
            static CacheKey()
            {
                List.Add(SiteConfigCacheKey, "站点信息缓存");
                //List.Add(PowerConfigCacheKey, "权限信息缓存");
                //List.Add(LoginAdminInfoCacheKey, "管理员信息缓存");
                //List.Add(LoginMemberInfoCacheKey, "会员信息缓存");
            }
        }
    }
}
